package com.jiashihui.schema_lgorithm.schema.memento;

/**
 * @author jiashihui
 * @describe: 原始类
 * @date 2019/03/15
 */
public class Original {
    /* 值 */
    private String value;

    public Original(String value) {
        this.value = value;
    }

    /**
     * 创建备忘录
     *
     * @author Kevin
     */
    public Memento createMemento() {
        return  new Memento(value);
    }

    /**
     * 恢复备忘录
     *
     * @author Kevin
     */
    public void restoreMemento(Memento memento) {
        this.value = memento.getValue();
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
